#include "linux/cdev.h"
#include "linux/wait.h"


/* device pipe */
struct pipe_device
{
    unsigned buffer_size;  /* size buffer in device */
    char *start, *end; /* start buffer address, end buffer address*/
    char *wp; /* current write pointer */
    char *rp; /* current read pointer */
    wait_queue_head_t wq, rq; /* wait queues for read/write operations */
    struct semaphore sem; /* protect from parallel access to device */
    struct cdev cdev;
};

int initPipeDevices(dev_t);
void clearPipeDevices();
